<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js运算符</title>
</head>
<body>
    <script>
        var age = 20;
        var _age = "20";
        var $age = 20;

        console.log(age == _age);
        console.log(age === _age);
        console.log(age === $age);

        console.log(typeof ('10' - 1))
        console.log(typeof ('10' + 1))
        console.log(parseInt('10'))
        console.log(parseInt("12a45"))
        console.log(parseInt("a12"))

        if (0){
            console.log("0 转换为false")
        }
        if (NaN){
            console.log("NaN 转换为false")
        }
        if (null){
            console.log("null 转换为false")
        }
        if (undefined){
            console.log("undefined 转换为false")
        }
        if (""){
            console.log("'' 转换为false")
        }
        if (" "){
            console.log("' ' 转换为true")
        }
        if ("0"){
            console.log("'0' 转换为true")
        }
        if ("false"){
            console.log("'false' 转换为true")
        }
        if ("null"){
            console.log("'null' 转换为true")
        }
    </script>
</body>
</html>